//
//  SPAccountController.h
//  Sophie
//
//  Created by Anton Chebotaev on 10/10/09.
//  Copyright 2009 IFMO. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import <LJClientKit/LJClientKit.h>

#import "EMKeychainItem.h"
#import "EMKeychainProxy.h"
#import "SPPreferencesController.h"

/*!
    @class SPAccountController
    @abstract Class is designed to manage Livejournal account, perform operations with it
    @discussion   
*/
@interface SPAccountController : NSObject {
	LJAccount* sharedAccount;
	NSOperationQueue* operationQueue;
}

@property (readonly) LJAccount* sharedAccount;
@property (readonly) NSOperationQueue* operationQueue;

+ (SPAccountController *)sharedController;

- (void)loadAccountFromDisk;
- (void)saveAccountToDisk;

// Adds account updaters to it's own NSOperationQueue 
- (void)reloadFromServerWithUsername:(NSString*)aUsername;
- (void)updateFromServer;

- (void)postEntry:(LJEntry*)entry;

@end